var mario = {
	id: "mario",
	visible: true,
	y: 0, x: 150,
	jumping: false,
	jumpCount: 0,
	
	init: function () {	
		this._dummyAction = this._move;
	},
	
	_dummyAction: function () {},
	
	_move: function (points) {
		//rigth
		if (jsGFwk.IO.keyboard._activeKey[39] && points.positions.rightMatrixPosition !== 1) {
			jsGFwk._gameObjects.mario.x++;
		}
		
		//left
		if (jsGFwk.IO.keyboard._activeKey[37] && points.positions.leftMatrixPosition !== 1) {
			jsGFwk._gameObjects.mario.x--;
		}
		
		if (jsGFwk.IO.keyboard._activeKey[38] && points.positions.topMatrixPosition !== 1 && !jsGFwk._gameObjects.mario.jumping) {
			jsGFwk._gameObjects.mario.jumping = true;
		}
		
		if (points.positions.bottomMatrixPosition !== 1 && 
				!jsGFwk._gameObjects.mario.jumping) {
			jsGFwk._gameObjects.mario.y++;
		}
		
		if (jsGFwk._gameObjects.mario.jumping) {
			if (points.positions.topMatrixPosition !== 1) {
				jsGFwk._gameObjects.mario.jumpCount++;
				if (jsGFwk._gameObjects.mario.jumpCount < 52) {
					jsGFwk._gameObjects.mario.y--;
				} else {
					jsGFwk._gameObjects.mario.jumping = false;
					jsGFwk._gameObjects.mario.jumpCount = 0;
				}
			}
		}
	},

	update: function(delta) {
		var points = jsGFwk._gameObjects.mapa._getGridRelation(this.x, this.y);
		this._dummyAction(points);
	},
	draw: function (context) {
		context.drawImage(jsGFwk.ResourceManager.graphics.sprites.image, 
			185, 784, 13, 16,
			jsGFwk._gameObjects.mario.x, jsGFwk._gameObjects.mario.y, 13, 16);
	}
};